package com.clubmg.pojo;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;

@Entity
public class Notice {
    private long nid;
    private Long cid;
    private String tittle;
    private String text;
    private String title;

    @Id
    @Column(name = "nid")
    public long getNid() {
        return nid;
    }

    public void setNid(long nid) {
        this.nid = nid;
    }

    @Basic
    @Column(name = "cid")
    public Long getCid() {
        return cid;
    }

    public void setCid(Long cid) {
        this.cid = cid;
    }

    @Basic
    @Column(name = "tittle")
    public String getTittle() {
        return tittle;
    }

    public void setTittle(String tittle) {
        this.tittle = tittle;
    }

    @Basic
    @Column(name = "text")
    public String getText() {
        return text;
    }

    public void setText(String text) {
        this.text = text;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        Notice notice = (Notice) o;

        if (nid != notice.nid) return false;
        if (cid != null ? !cid.equals(notice.cid) : notice.cid != null) return false;
        if (tittle != null ? !tittle.equals(notice.tittle) : notice.tittle != null) return false;
        if (text != null ? !text.equals(notice.text) : notice.text != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = (int) (nid ^ (nid >>> 32));
        result = 31 * result + (cid != null ? cid.hashCode() : 0);
        result = 31 * result + (tittle != null ? tittle.hashCode() : 0);
        result = 31 * result + (text != null ? text.hashCode() : 0);
        return result;
    }

    @Basic
    @Column(name = "title")
    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }
}
